package com.baor.feign;


import com.baor.domain.OrderVo;
import com.baor.feign.impl.DistributionFeignImpl;
import com.baor.utils.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Service
@FeignClient(name = "eureka-distribution",fallback = DistributionFeignImpl.class )
public interface DistributionFeign {

    /**
     * 会员余额
     * @param map{
     *     "siteId":1,
     *     "source":"佣金",
     *     "type":"余额",
     *     "startTime":"2024-05-22 19:28:40",
     *     "endTime":"2024-05-22 19:28:40"
     * }
     * @return
     */
    @RequestMapping("/mall/distribution/yue/list")
    AjaxResult<?> yueList(@RequestBody Map<String,Object> map);


    /**
     * 会员佣金
     * @param map{
     *     "siteId":1,
     *     "source":"佣金",
     *     "startTime":"2024-05-22 19:28:40",
     *     "endTime":"2024-05-22 19:28:40"
     * }
     * @return
     */
    @RequestMapping("/mall/distribution/money/list")
    AjaxResult<?> moneyList(@RequestBody Map<String,Object> map);

    /**
     * 订单日志变化影响分校返现
     * 在订单日志状态变更之后传入订单日志 id
     * @param logId
     * @return
     */
    @RequestMapping("/mall/distribution/distribution/disMoney/{logId}")
    AjaxResult<?> disMoney(@PathVariable Integer logId);

    /**
     * 插入订单时调用
     */
    @RequestMapping("/mall/distribution/proxyOrder/insertProxyOrder")
    AjaxResult<?> insertProxyOrder(@RequestBody OrderVo vo);

    /**
     * 该包订单状态调用
     */
    @RequestMapping("/mall/distribution/proxyOrder/updateCommission")
    AjaxResult<?> updateCommission(@RequestParam Integer orderId);

    /**
     * 改变订单状态调用
     */
    @RequestMapping("/mall/distribution/proxyOrder/updateCommission")
    AjaxResult<?> people(@RequestParam int userId);

}
